import { HYEventStore } from "hy-event-store"
import { getSongRecommend } from "../service/request/main"
const rankingMap = {
  newRanking:3779629,
  originRanking: 2884035,
  uperRanking: 19723756
}
const rankingStore = new HYEventStore({
  state: {
    newRanking:{},
    originRanking: {},
    uperRanking: {}
  },
  actions: {
    fetchRankingList(ctx) {
      for(const key in rankingMap) {
        const id = rankingMap[key]
        getSongRecommend(id).then(res => {
          ctx[key] = res.playlist
        })
      }
    }
  }
})


export default rankingStore
